import { axios } from "@/utils/request";
import { baseUrl } from "@/services/baseUrl";

//项目立项、土地手续 【分页】
export function getCantonListPage(data) {
  let { page, pageSize } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/constructionProgram/getPageSet?pageNo=${page}&pageSize=${pageSize}&order=desc&sort=createTime`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//项目立项、土地手续-【详情】
export function detailCanton(data) {
  return axios({
    url: baseUrl + `/probusiness/constructionProgram/getDetailByUuidHasData`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//项目立项、土地手续-【保存】
export function saveCanton(data) {
  return axios({
    url: baseUrl + `/probusiness/constructionProgram/saveOrUpdateFile`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//项目立项、土地手续-【删除】
export function deleteCanton(data) {
  let { uuid } = data;
  return axios({
    url: baseUrl + `/probusiness/constructionProgram/deleteBatch?uuids=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//合同审批-【分页】
export function pageContractApproval(data) {
  let { page, pageSize } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/contractApprovalProcess/getPageSet?pageNo=${page}&pageSize=${pageSize}&order=desc&sort=createTime`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//查询合同下拉框
export function getContractByProCode(params) {
  return axios({
    url: baseUrl + `/probusiness/contractDecomposeDetail/queryListByProCode`,
    method: "GET",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    params,
  });
}
//合同审批-【保存】
export function saveContractApproval(data) {
  return axios({
    url: baseUrl + `/probusiness/contractApprovalProcess/saveOrUpdateData`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//合同审批-【详情】
export function detailContractApproval(data) {
  let { uuid } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/contractApprovalProcess/getDetailByUuid?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//合同审批-【删除】
export function deleteContractApproval(data) {
  let { uuid } = data;
  return axios({
    url:
      baseUrl + `/probusiness/contractApprovalProcess/deleteData?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//合同审批-【提交】
export function submitContractApproval(data) {
  let { uuid } = data;
  return axios({
    url:
      baseUrl + `/probusiness/contractApprovalProcess/submitData?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//合同审批-审批
export function approveContractApproval(data) {
  return axios({
    url: baseUrl + `/probusiness/contractApprovalProcess/approveData`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//合同变更-【分页】
export function pageContractChange(data) {
  let { page, pageSize } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/contractAmendmentProcess/getPageSet?pageNo=${page}&pageSize=${pageSize}&order=desc&sort=createTime`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//查询审批通过合同下拉框
export function getApprovalContract(params) {
  return axios({
    url:
      baseUrl +
      `/probusiness/contractApprovalProcess/queryCompleteListByProCode`,
    method: "GET",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    params,
  });
}
//合同变更-【保存】
export function saveContractChange(data) {
  return axios({
    url: baseUrl + `/probusiness/contractAmendmentProcess/saveOrUpdateData`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//合同变更-【详情】
export function detailContractChange(data) {
  let { uuid } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/contractAmendmentProcess/getDetailByUuid?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//合同变更-【删除】
export function deleteContractChange(data) {
  let { uuid } = data;
  return axios({
    url:
      baseUrl + `/probusiness/contractAmendmentProcess/deleteData?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//合同变更-【提交】
export function submitContractChange(data) {
  let { uuid } = data;
  return axios({
    url:
      baseUrl + `/probusiness/contractAmendmentProcess/submitData?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//合同变更-审批
export function approveContractChange(data) {
  return axios({
    url: baseUrl + `/probusiness/contractAmendmentProcess/approveData`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//概算-【分页】
export function pageCostManager(data) {
  let { page, pageSize } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/costManager/getPageSet?pageNo=${page}&pageSize=${pageSize}&order=desc&sort=createTime`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//概算-下载模版
export function downloadCostManagerTemplate(data) {
  return axios({
    url: baseUrl + `/probusiness/costManager/exportTemplates`,
    method: "POST",
    apiType: "file",
    responseType: "arraybuffer",
    data,
  });
}

//概算-项目下拉框
export function costManagerProjectList(data) {
  const { moudle } = data;
  return axios({
    url: baseUrl + `/probusiness/costManager/getProListByQX?moudle=${moudle}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
  });
}
//概算-【保存】
export function savecostManager(data) {
  return axios({
    url: baseUrl + `/probusiness/costManager/saveOrUpdateData`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//概算-【详情】
export function detailCostManager(data) {
  let { uuid } = data;
  return axios({
    url: baseUrl + `/probusiness/costManager/getDetailByUuid?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//概算-【删除】
export function deleteCostManager(data) {
  let { uuid } = data;
  return axios({
    url: baseUrl + `/probusiness/costManager/deleteData?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//概算-【提交】
export function submitCostManager(data) {
  let { uuid } = data;
  return axios({
    url: baseUrl + `/probusiness/costManager/submitData?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//概算-【审批】
export function approveCostManager(data) {
  return axios({
    url: baseUrl + `/probusiness/costManager/approveData`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//合同分解-【分页】
export function pageContractDecompose(data) {
  let { page, pageSize } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/contractDecomposeDetail/getPageSet?pageNo=${page}&pageSize=${pageSize}&order=desc&sort=createTime`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//合同分解-【保存】
export function saveContractDecompose(data) {
  return axios({
    url: baseUrl + `/probusiness/contractDecomposeDetail/addOrUpdate`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//合同分解-【详情】
export function detailContractDecompose(data) {
  return axios({
    url: baseUrl + `/probusiness/contractDecompose/getDetail`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
//合同分解-【删除】
export function deleteContractDecompose(data) {
  let { uuid } = data;
  return axios({
    url:
      baseUrl + `/probusiness/contractDecomposeDetail/deleteData?uuid=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
